package org.template.dao;

import org.springframework.stereotype.Repository;

@Repository
public class QueueRedisDao extends ListRedisDao {

	
	/**
	 * 用redis list实现一个简易的消息队列 处理消息  注意是非阻塞式的
	 * @param destination
	 * @param msgBody
	 */
	public void producerMsg(String destination,String msgBody){
		addListElement(destination,true,msgBody);
	}
	
	public String consumerMsg(String destination){
		return getListElement(destination, false);
	}
}
